#ifndef __ON_OFF_CLUSTER_H__
#define __ON_OFF_CLUSTER_H__

#ifdef __cplusplus
extern "C"
{
#endif

#include "tuya_cloud_types.h"
#include "app_light_control.h"
#include "app_common.h"
#include "app_light_tools.h"
#include "tal_data_send.h"
#include "tkl_endpoint_register.h"

OPERATE_RET app_onoff_cluster_handler(UCHAR_T cmd, UINT8_T *payload, UINT8_T payload_len, ZIGBEE_CMD_T cmd_type);

/**
 * @note app_onoff_count_down_response
 * @param [in] {ULONG_T} set count down s
 * @return: none
 */
VOID_T app_onoff_count_down_response(ULONG_T remain_time_sec);

/**
 * @note app_onoff_handle_count_down
 * @param [in]{UCHAR_T} delay_ms 
 * @param 
 * @return: none
 */
VOID_T app_onoff_handle_count_down(ULONG_T delay_ms);

VOID_T app_onoff_set_count_down_report_flag_time(UINT8_T flag, ULONG_T delay_ms);

/**
 * @note report onoff attribute value
 * @param [in] {TAL_SEND_QOS_E} Qos
 * @param [in] {USHORT_T} delay_ms
 * @param [in] {UINT8_T} onoff
 * @return: none
 */
VOID_T app_onoff_report_value(TAL_SEND_QOS_E qos, USHORT_T delay_ms, UINT8_T onoff);

/**
 * @note app_onoff_report_count_down_data
 * @param [in] {TAL_SEND_QOS_E} QOS 
 * @param [in] {USHORT_T} delay_ms
 * @param [in] {USHORT_T} countdown
 * @return: none
 */
VOID_T app_onoff_report_count_down_data(TAL_SEND_QOS_E Qos, USHORT_T delay_ms, ULONG_T countdown);

#ifdef __cplusplus
}
#endif

#endif